#Boa:Dialog:Dialog1

import wx

def create(parent):
    return Dialog1(parent)

[wxID_DIALOG1, wxID_DIALOG1LISTBOX1, wxID_DIALOG1PANEL1, 
] = [wx.NewId() for _init_ctrls in range(3)]

class Dialog1(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DIALOG1, name='', parent=prnt,
              pos=wx.Point(494, 124), size=wx.Size(319, 403),
              style=wx.DEFAULT_DIALOG_STYLE, title='Seleccione un proveedor')
        self.SetClientSize(wx.Size(311, 376))

        self.panel1 = wx.Panel(id=wxID_DIALOG1PANEL1, name='panel1',
              parent=self, pos=wx.Point(0, 0), size=wx.Size(368, 488),
              style=wx.TAB_TRAVERSAL)

        self.listBox1 = wx.ListBox(choices=[], id=wxID_DIALOG1LISTBOX1,
              name='listBox1', parent=self.panel1, pos=wx.Point(8, 8),
              size=wx.Size(296, 360), style=0)
        self.listBox1.Bind(wx.EVT_LISTBOX_DCLICK, self.OnDobleClick,
              id=wxID_DIALOG1LISTBOX1)

    def __init__(self, parent, lista):
        self._init_ctrls(parent)
        self.clientes = lista
        self.seleccion = ""
        for item in self.clientes:
            nombre = item["nombre"]
            id = item["idproveedor"]
            cadena = nombre + " / " + str(id)
            self.listBox1.Append(cadena)

    def OnDobleClick(self, event):
        seleccion = self.listBox1.GetSelection()
        self.seleccion = self.clientes[seleccion]
        self.Close()
